<template>
	<view class="formula-pages">
		<CustomNav :isBack="true" :topBgColor="topBgColor" title="反映问题"></CustomNav>
		<image src="@/static/image/home/bg.png" class="bg-img"></image>
		<view class="info-block" :style="'margin-top:'+mt">
			<view class="info-item block">
				<mp-html :content="info.content" :style="containerStyle"></mp-html>
			</view>
			<view class="btn-block">
				<view class="btn normal" v-if="state==2" @click="navigate('/pages/reflect/problem')">下一步
				</view>
				<view class="btn disabled" v-else><text style="margin-right: 6rpx;">下一步</text>
					<uni-section type="line" padding>
						<uni-countdown :show-day="false" :showHour="false" :showMinute="false" :second="5"
							@timeup="state=2" />
					</uni-section>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getInstructionsDetailApi
	} from '@/api/home.js'
	export default {
		components: {},
		data() {
			return {
				info: {
					title: '',
					content: '',
				},
				state: 1,
			}
		},
		methods: {
			getInstructionsDetail() {
				getInstructionsDetailApi().then(res => {
					this.info = res
				})
			},
			previewImg(url) {
				uni.previewImage({
					current: url,
					urls: [this.cloudStorage + this.info.flowChart]
				})
			},
		},
		onLoad(e) {
			this.getInstructionsDetail();
		}
	}
</script>

<style lang="scss" scoped>
	.formula-pages {
		overflow: hidden;
		min-height: 100vh;
		background-color: #F8FBFF;

		.bg-img {
			width: 100%;
			height: 100%;
			position: absolute;
		}

		.info-block {
			position: relative;
			padding: 30rpx;

			.block {
				background-color: #fff;
				padding: 30rpx;
				border-radius: 30rpx;
			}

			.menu-block {
				display: flex;
				align-items: center;

				.icon-img {
					width: 100rpx;
					height: 100rpx;
					border-radius: 16rpx;
					background-color: #F8FBFF;
					margin-right: 20rpx;
				}

				.title {
					font-weight: bold;
					font-size: 34rpx;
					width: calc(100% - 120rpx);
				}
			}

			.info-item {
				margin-top: 30rpx;

				.title-item {
					display: flex;
					align-items: center;

					.line {
						width: 15rpx;
						height: 32rpx;
						background-color: #4A8DFF;
						border-radius: 30rpx;
						margin-right: 20rpx;
					}

					.name {
						font-weight: bold;
						font-size: 32rpx;
					}
				}

				.info-img {
					width: 100%;
					margin-top: 30rpx;
				}
			}

			.btn-block {
				margin-top: 30rpx;
				display: flex;
				align-items: center;
				justify-content: center;

				.btn {
					display: flex;
					align-items: center;
				}
			}
		}
	}
</style>